#ifndef __DBMYSQL_H__
#define __DBMYSQL_H__

#include <mysql.h>
#include "ddm.h"
namespace DDM
{
class DB_MySql : public Database
{
public:
	DB_MySql(void);
	~DB_MySql(void);

    int connect(const char *host, const char *user, const char *passwd, const char *db=NULL);
    bool IsConnected();
    void close();

    int execute(const char* sql);
	int real_execute(const char* sql, vector<DBCol*> *cols);
    int get_rows(vector<DBRow*> *prows);
    int execute_with_result(const char* sql, std::vector<DBRow*> *records);

    const char* db_error() const;
private:
    MYSQL *conn;
};
}
#endif
